﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using TimKen.App;
using System.Data;

namespace TimKen.Web
{
    public partial class Industry : WebPage
    {
        public DataRowCollection drcIndustry;
        public BussLogic.Industry industry = new TimKen.BussLogic.Industry();
        public string parentLink;
        public int industryID = 0;
        public static string id;
        protected void Page_Load(object sender, EventArgs e)
        {
            //绑定应用行业
            DataSet dsIndustry = (new TimKen.BussLogic.Industry()).GetList("ParentID=0");
            drcIndustry = dsIndustry.Tables[0].Rows;
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                id = Request.QueryString["id"];
            }
            else
            {
                id = Request.QueryString["industryid"];
            }
            if (string.IsNullOrEmpty(Request.QueryString["industryid"]))
            {
                industryID = 0;
            }
            else
            {
                industryID = int.Parse(Request.QueryString["industryid"]);
            }
            DataSet ds = industry.GetList("ParentID=" + industryID);
            if (ds.Tables[0].Rows.Count == 0)
            {
                Response.Redirect("/Product.aspx?IndustryID=" + industryID);
            }
            else
            {
                dlCategory.DataSource = ds;
                dlCategory.DataBind();
            }
        }
    }
}